/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Helper.TTAHelper;

import java.io.Serializable;

/**
 *
 * @author Lu Xiaodi
 */
public class Helper_CustomerValue implements Serializable, Comparable {

    private Long customerId;
    private String customerEmail;
    private Double custValue;
    private Integer rank;

    public Helper_CustomerValue() {
    }

    public Helper_CustomerValue(Long customerId, String customerEmail, Double loyaltyIndex) {
        this.customerId = customerId;
        this.customerEmail = customerEmail;
        this.custValue = loyaltyIndex;
    }

    public Helper_CustomerValue(Long customerId, String customerEmail, Double loyaltyIndex,
            Integer rank) {
        this.customerId = customerId;
        this.customerEmail = customerEmail;
        this.custValue = loyaltyIndex;
        this.rank = rank;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Double getCustValue() {
        return custValue;
    }

    public void setCustValue(Double loyaltyIndex) {
        this.custValue = loyaltyIndex;
    }

    public Integer getRank() {
        return rank;
    }

    public void setRank(Integer rank) {
        this.rank = rank;
    }

    public String getCustomerEmail() {
        return customerEmail;
    }

    public void setCustomerEmail(String customerEmail) {
        this.customerEmail = customerEmail;
    }

    @Override
    public int compareTo(Object o) {
        if (!(o instanceof Helper_CustomerValue)) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
        else if (this.getCustValue()> ((Helper_CustomerValue)o).getCustValue()){
            return 1;
        } else if (this.getCustValue()< ((Helper_CustomerValue)o).getCustValue()){
            return -1;
        } else
            return 0;
    }
}
